using DevExpress.XtraEditors;
using DevExpress.XtraTab;
using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace NoteManger
{
	public class FrmEditNote:Form
	{
		public enum TEditMode
		{
			NewNote,
			AlterNote
		}
		private long Frequency = 0L;
		private long StartCount = 0L;
		private long EndCount = 0L;
		private int iOldSelectedIndex = -1;
		private string _sourcefilename = "";
		private string _destfilename = "";
		private NoteRemote _NoteRemoteObject = null;
		private TLoginInfo _LoginInfo = new TLoginInfo();
		private FrmEditNote.TEditMode _EditMode = FrmEditNote.TEditMode.NewNote;
		private string _CurrentDate = string.Empty;
		private string _LastNewNoteID = string.Empty;
		private bool _NeedRefresh = false;
		private NoteClientCtl _objNoteClientCtl = null;
		private string _OldNoteID = "";
		private ListView objNoteExpandField = new ListView();
		private int iLabelAndCtlWidth = 4;
		private int iEditControlWidthOffSet = 15;
		private IContainer components = null;
		private System.Windows.Forms.ComboBox cbbWorkLoad;
		private Label label3;
		private Button btnCancel;
		private Button btnSave;
		private DateTimePicker dtpdate;
		private Label lbNoteDate;
		private TextBox tboxtopic;
		private Label label1;
		private PictureBox pboxDate;
		private PictureBox pboxTopic;
		private PictureBox pboxBody;
		private PictureBox pboxWorkLoad;
		private DateTimePicker dtpendtime;
		private Label label5;
		private Label label4;
		private DateTimePicker dtpbegintime;
		private Label lbMsg;
		private Panel panel1;
		private RadioButton rbbtn1;
		private Panel panel5;
		private RadioButton rbbtn5;
		private Panel panel4;
		private RadioButton rbbtn4;
		private Panel panel3;
		private RadioButton rbbtn3;
		private Panel panel2;
		private RadioButton rbbtn2;
		private ToolTip toolTip;
		private Timer timspy;
		private Label label7;
		private System.Windows.Forms.ComboBox cbbNoteTypeName;
		private Button btnReferesh;
		private ImageList imageList;
		public GroupBox groupBoxMain;
		private ToolTip toolTipEx;
		private System.Windows.Forms.ComboBox cbbNoteTypeID;
		private XtraTabControl xtraTabControl;
		private XtraTabPage xtraTabPage1;
		public RichTextBox rtboxbody;
		private XtraTabPage xtraTabPage2;
		private XtraScrollableControl xtraScrollableControl;
		private TextBox tboxHospName;
		private Label label6;
		private Label label2;
		private System.Windows.Forms.ComboBox cbbCity;
		private System.Windows.Forms.ComboBox cbbProvince;
		public NoteRemote NoteRemoteObject
		{
			set
			{
				this._NoteRemoteObject = value;
			}
		}
		public TLoginInfo LoginInfo
		{
			set
			{
				this._LoginInfo = value;
			}
		}
		public FrmEditNote.TEditMode EditMode
		{
			set
			{
				this._EditMode = value;
			}
		}
		public string CurrentDate
		{
			get
			{
				return this._CurrentDate;
			}
			set
			{
				this._CurrentDate = value;
			}
		}
		public string LastNewNoteID
		{
			get
			{
				return this._LastNewNoteID;
			}
			set
			{
				this._LastNewNoteID = value;
			}
		}
		public bool NeedRefresh
		{
			get
			{
				return this._NeedRefresh;
			}
		}
		public NoteClientCtl objNoteClientCtl
		{
			set
			{
				this._objNoteClientCtl = value;
			}
		}
		[DllImport("User32.dll")]
		private static extern bool SetForegroundWindow(IntPtr hWnd);
		[DllImport("User32.dll")]
		private static extern int SendMessage(int hWnd, int Msg, int wParam, int lParam);
		[DllImport("User32.dll")]
		private static extern int ReleaseCapture();
		[DllImport("kernel32.dll")]
		private static extern bool QueryPerformanceFrequency(ref long lpFrequency);
		[DllImport("kernel32.dll")]
		private static extern bool QueryPerformanceCounter(ref long lpPerformanceCount);
		private void ReadLocalWorkNotesConfig()
		{
			try
			{
				RegistryKey localMachine = Registry.LocalMachine;
				RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
				object value = registryKey.GetValue("NoteClientStartPath");
				if (value != null)
				{
					this._sourcefilename = Convert.ToString(value) + "\\LocalWorkNotes.mdb";
				}
				value = registryKey.GetValue("WorkNotesAutoBackupPath");
				if (value == null)
				{
					string text = "D:\\WorkNotesAutoBackup";
					if (!Directory.Exists(text))
					{
						Directory.CreateDirectory(text);
					}
					this._destfilename = text + "\\LocalWorkNotes.mdb";
				}
				else
				{
					string text = Convert.ToString(value);
					if (!Directory.Exists(text))
					{
						Directory.CreateDirectory(text);
					}
					this._destfilename = text + "\\LocalWorkNotes.mdb";
				}
			}
			catch
			{
			}
		}
		public void ShowEditNoteForm()
		{
			FrmEditNote.SetForegroundWindow(base.Handle);
		}
		public FrmEditNote()
		{
			this.InitializeComponent();
			try
			{
				System.Drawing.Image image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Date.png");
				this.pboxDate.Image = image;
				image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Topic.png");
				this.pboxTopic.Image = image;
				image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\WorkLoad.png");
				this.pboxWorkLoad.Image = image;
				image = System.Drawing.Image.FromFile(NoteRemote.GetNoteClientStartPath() + "\\png\\Body.png");
				this.pboxBody.Image = image;
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			this.ReadLocalWorkNotesConfig();
			FrmEditNote.QueryPerformanceFrequency(ref this.Frequency);
		}
		public void GetNoteInfo(string aNoteID)
		{
			try
			{
				if (!this._NoteRemoteObject.ConnectionTest())
				{
					MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				return;
			}
			if (this.cbbNoteTypeName.Items.Count == 0)
			{
				this.GetRemoteNoteType(true);
			}
			string[] array = new string[0];
			string text = "";
			bool flag = false;
			try
			{
				flag = this._NoteRemoteObject.GetNoteInfo(aNoteID, ref array, ref text);
			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
			if (flag)
			{
				this._OldNoteID = array[0];
				this.tboxtopic.Text = array[2];
				this.rtboxbody.Text = array[3];
				this.dtpdate.Value = Convert.ToDateTime(array[4]);
				this.dtpdate.Enabled = false;
				this.cbbWorkLoad.Text = array[5];
				try
				{
					this.dtpbegintime.Value = Convert.ToDateTime(array[13]);
				}
				catch
				{
					this.dtpbegintime.Value = Convert.ToDateTime("00:00:00");
				}
				try
				{
					this.dtpendtime.Value = Convert.ToDateTime(array[14]);
				}
				catch
				{
					this.dtpendtime.Value = Convert.ToDateTime("00:00:00");
				}
				try
				{
					this.cbbNoteTypeName.SelectedIndex = Convert.ToInt32(this.cbbNoteTypeID.Items.IndexOf(array[15]));
				}
				catch
				{
					this.cbbNoteTypeName.SelectedIndex = this.cbbNoteTypeName.Items.Count - 1;
				}
				if (this.cbbNoteTypeName.SelectedIndex == -1)
				{
					this.cbbNoteTypeName.SelectedIndex = this.cbbNoteTypeName.Items.Count - 1;
				}
				string[,] array2 = new string[0, 0];
				string aStrSql = "select Address,Hospital from WorkNotes where NoteID = '" + this._OldNoteID + "'";
				this._NoteRemoteObject.CommonQuery(aStrSql, ref array2, ref text);
				if (array2[0, 0] != "")
				{
					int num = array2[0, 0].IndexOf(".");
					this.cbbProvince.SelectedIndex = this.cbbProvince.Items.IndexOf(array2[0, 0].Substring(0, num));
					this.cbbCity.SelectedIndex = this.cbbCity.Items.IndexOf(array2[0, 0].Substring(num + 1, array2[0, 0].Length - num - 1));
				}
				this.tboxHospName.Text = array2[0, 1];
				this.ShowExpandFields();
				if (this.objNoteExpandField.Items.Count != 0)
				{
					string[,] array3 = new string[0, 0];
					flag = this._NoteRemoteObject.CommonQuery("select FieldCode,FieldValue from WorkNotesExpand(nolock) where NoteID= " + this._OldNoteID, ref array3, ref text);
					if (flag)
					{
						int num2 = array3.GetUpperBound(0) - array3.GetLowerBound(0) + 1;
						int num3 = array3.GetUpperBound(1) - array3.GetLowerBound(1) + 1;
						for (int i = 0; i < num2; i++)
						{
							for (int j = 0; j < this.objNoteExpandField.Items.Count; j++)
							{
								ListViewItem listViewItem = new ListViewItem();
								listViewItem = this.objNoteExpandField.Items[j];
								if (listViewItem.SubItems[0].Text == array3[i, 0])
								{
									string text2 = listViewItem.SubItems[5].Text;
									Control[] array4 = this.xtraScrollableControl.Controls.Find(text2, false);
									if (array4.Length != 0)
									{
										if (array4[0] is NumericUpDown)
										{
											decimal value = 0m;
											decimal.TryParse(array3[i, 1], out value);
											((NumericUpDown)array4[0]).Value = value;
										}
										if (array4[0] is TextBox)
										{
											((TextBox)array4[0]).Text = array3[i, 1];
										}
										if (array4[0] is DateTimePicker)
										{
											DateTime value2;
											DateTime.TryParse(array3[i, 1], out value2);
											((DateTimePicker)array4[0]).Value = value2;
										}
									}
								}
							}
						}
					}
				}
			}
			else
			{
				MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
			}
		}
		private void FrmEditNote_Load(object sender, EventArgs e)
		{
			this.cbbWorkLoad.Items.Clear();
			this.cbbWorkLoad.Items.Add(0);
			for (int i = 1; i <= 24; i++)
			{
				double num = (double)i - 0.5;
				this.cbbWorkLoad.Items.Add(num);
				this.cbbWorkLoad.Items.Add(i);
			}
			this.cbbWorkLoad.Text = "8";
			this.dtpbegintime.Text = "08:30:00";
			this.dtpendtime.Text = "17:00:00";
			this.ReadClientConfig();
			this.btnReferesh.Cursor = Cursors.Hand;
			this.CreateColumnExpandInfo();
			if (this.cbbNoteTypeName.Text.Trim() == "现场支持")
			{
				this.cbbProvince.Enabled = true;
				this.cbbCity.Enabled = true;
				this.tboxHospName.Enabled = true;
				this.cbbProvince.Focus();
				this.tboxHospName.BackColor = System.Drawing.Color.White;
			}
			else
			{
				this.cbbProvince.Enabled = false;
				this.cbbCity.Enabled = false;
				this.tboxHospName.Enabled = false;
				this.tboxHospName.BackColor = System.Drawing.Color.Gainsboro;
			}
		}
		private void CreateColumnExpandInfo()
		{
			ColumnHeader columnHeader = new ColumnHeader();
			columnHeader.Text = "字段编号";
			columnHeader.Width = 65;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "对应日志分类代码";
			columnHeader.Width = 110;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "字段名称";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "字段数据类型";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "是否可为空";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
			columnHeader = new ColumnHeader();
			columnHeader.Text = "控件名称";
			columnHeader.Width = 100;
			columnHeader.TextAlign = HorizontalAlignment.Left;
			this.objNoteExpandField.Columns.Add(columnHeader);
		}
		private Array ChangeArrayLength(Array oriArray, int Row, int Col)
		{
			Type elementType = oriArray.GetType().GetElementType();
			Array array = Array.CreateInstance(elementType, Row, Col);
			Array.Copy(oriArray, 0, array, 0, Math.Min(oriArray.Length, Row * Col));
			return array;
		}
		private void GetExpandParaValue(ref string aParaString, ref int aParaCount, ref string[,] aArrPara)
		{
			aParaString = "";
			aParaCount = 0;
			if (this.objNoteExpandField.Items.Count != 0)
			{
				int num = this.xtraScrollableControl.Controls.Count;
				num /= 2;
				aArrPara = (string[,])this.ChangeArrayLength(aArrPara, this.objNoteExpandField.Items.Count, 2);
				for (int i = 0; i < this.objNoteExpandField.Items.Count; i++)
				{
					ListViewItem listViewItem = new ListViewItem();
					listViewItem = this.objNoteExpandField.Items[i];
					int num2 = Convert.ToInt32(listViewItem.SubItems[3].Text);
					string text = "";
					if (num2 == 0)
					{
						text = ((NumericUpDown)this.xtraScrollableControl.Controls[num + i]).Value.ToString();
					}
					if (num2 >= 1 && num2 <= 7)
					{
						if (this.xtraScrollableControl.Controls[num + i] is TextBox)
						{
							text = ((TextBox)this.xtraScrollableControl.Controls[num + i]).Text;
						}
						if (this.xtraScrollableControl.Controls[num + i] is RichTextBox)
						{
							text = ((RichTextBox)this.xtraScrollableControl.Controls[num + i]).Text;
						}
					}
					if (num2 == 8)
					{
						text = ((DateTimePicker)this.xtraScrollableControl.Controls[num + i]).Value.ToString("yyyy-MM-dd");
					}
					if (num2 == 9)
					{
						text = ((DateTimePicker)this.xtraScrollableControl.Controls[num + i]).Value.ToString("HH:mm:ss");
					}
					if (num2 == 10)
					{
						text = ((NumericUpDown)this.xtraScrollableControl.Controls[num + i]).Value.ToString();
					}
					if (num2 == 11)
					{
						text = ((NumericUpDown)this.xtraScrollableControl.Controls[num + i]).Value.ToString();
					}
					if (num2 == 12)
					{
						text = ((System.Windows.Forms.ComboBox)this.xtraScrollableControl.Controls[num + i]).SelectedIndex.ToString();
					}
					if (num2 == 13)
					{
						System.Windows.Forms.ComboBox comboBox = (System.Windows.Forms.ComboBox)this.xtraScrollableControl.Controls[num + i];
						System.Windows.Forms.ComboBox comboBox2 = (System.Windows.Forms.ComboBox)comboBox.Tag;
						if (comboBox.SelectedIndex != -1)
						{
							text = comboBox.Text + "(" + comboBox2.Items[comboBox.SelectedIndex].ToString() + ")";
						}
						else
						{
							text = "";
						}
					}
					if (num2 == 14)
					{
						System.Windows.Forms.ComboBox comboBox = (System.Windows.Forms.ComboBox)this.xtraScrollableControl.Controls[num + i];
						System.Windows.Forms.ComboBox comboBox2 = (System.Windows.Forms.ComboBox)comboBox.Tag;
						if (comboBox.SelectedIndex != -1)
						{
							text = comboBox.Text + "(" + comboBox2.Items[comboBox.SelectedIndex].ToString() + ")";
						}
						else
						{
							text = "";
						}
					}
					aParaString = string.Concat(new string[]
					{
						aParaString,
						listViewItem.SubItems[0].Text,
						"~",
						text,
						"|"
					});
					aParaCount++;
					aArrPara[i, 0] = listViewItem.SubItems[0].Text;
					aArrPara[i, 1] = text;
				}
			}
		}
		private void btnSave_Click(object sender, EventArgs e)
		{
			string text = "";
			this.tboxtopic.Focus();
			float num = 0f;
			float.TryParse(this.cbbWorkLoad.Text, out num);
			if (this.cbbNoteTypeName.Items.Count <= 1)
			{
				MessageBox.Show("本地日志分类表未和服务器同步过，无法保存日志！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				this.cbbNoteTypeName.Focus();
			}
			else
			{
				int selectedIndex = this.cbbNoteTypeName.SelectedIndex;
				if (selectedIndex <= -1)
				{
					MessageBox.Show("日志分类未选择！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					this.cbbNoteTypeName.Focus();
				}
				else
				{
					if (this.cbbNoteTypeName.Text.Trim() == "现场支持")
					{
						if (this.cbbProvince.Text.Trim() == "")
						{
							MessageBox.Show("当日志分类选择“现场支持”时，需要输入“地点”和“医院名称”！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.cbbProvince.Focus();
							return;
						}
						if (this.cbbCity.Text.Trim() == "")
						{
							MessageBox.Show("当日志分类选择“现场支持”时，需要输入“地点”和“医院名称”！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.cbbCity.Focus();
							return;
						}
						if (this.tboxHospName.Text.Trim() == "")
						{
							MessageBox.Show("当日志分类选择“现场支持”时，需要输入“地点”和“医院名称”！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.tboxHospName.Focus();
							return;
						}
					}
					if (num <= 0f)
					{
						if (MessageBox.Show("工作量为0，确定吗？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
						{
							return;
						}
					}
					if (this.objNoteExpandField.Items.Count != 0)
					{
						for (int i = 0; i < this.objNoteExpandField.Items.Count; i++)
						{
							ListViewItem listViewItem = new ListViewItem();
							listViewItem = this.objNoteExpandField.Items[i];
							if (listViewItem.SubItems[4].Text == "1")
							{
								if (Convert.ToInt32(listViewItem.SubItems[3].Text) >= 1 && Convert.ToInt32(listViewItem.SubItems[3].Text) <= 7)
								{
									for (int j = 0; j < this.xtraScrollableControl.Controls.Count; j++)
									{
										if (this.xtraScrollableControl.Controls[j].Name == listViewItem.SubItems[5].Text)
										{
											if (this.xtraScrollableControl.Controls[j].Text == "")
											{
												MessageBox.Show("<" + listViewItem.SubItems[2].Text + ">不能为空！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
												this.xtraScrollableControl.Controls[j].Focus();
												return;
											}
										}
									}
								}
							}
						}
					}
					int num2 = this.xtraScrollableControl.Controls.Count;
					num2 /= 2;
					if (this.objNoteExpandField.Items.Count != 0)
					{
						this.rtboxbody.Clear();
						for (int i = 0; i < this.objNoteExpandField.Items.Count; i++)
						{
							ListViewItem listViewItem = new ListViewItem();
							listViewItem = this.objNoteExpandField.Items[i];
							int num3 = Convert.ToInt32(listViewItem.SubItems[3].Text);
							if (num3 == 0)
							{
								string str = ((NumericUpDown)this.xtraScrollableControl.Controls[num2 + i]).Value.ToString();
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
							if (num3 >= 1 && num3 <= 7)
							{
								string str = ((TextBox)this.xtraScrollableControl.Controls[num2 + i]).Text;
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
							if (num3 == 8)
							{
								string str = ((DateTimePicker)this.xtraScrollableControl.Controls[num2 + i]).Value.ToString("yyyy-MM-dd");
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
							if (num3 == 9)
							{
								string str = ((DateTimePicker)this.xtraScrollableControl.Controls[num2 + i]).Value.ToString("HH:mm:ss");
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
							if (num3 == 10)
							{
								string str = ((NumericUpDown)this.xtraScrollableControl.Controls[num2 + i]).Value.ToString();
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
							if (num3 == 11)
							{
								string str = ((NumericUpDown)this.xtraScrollableControl.Controls[num2 + i]).Value.ToString();
								string text2 = ((Label)this.xtraScrollableControl.Controls[i]).Text;
								this.rtboxbody.AppendText(text2 + ":" + str + "\n");
							}
						}
					}
					string aParaString = "";
					int aParaCount = 0;
					string[,] aArrPara = new string[0, 0];
					this.GetExpandParaValue(ref aParaString, ref aParaCount, ref aArrPara);
					if (this.cbbNoteTypeName.Text == "现场支持")
					{
						aParaString = string.Concat(new string[]
						{
							this.cbbProvince.Text,
							".",
							this.cbbCity.Text,
							"|",
							this.tboxHospName.Text
						});
						aParaCount = -2;
					}
					if (this._LoginInfo.LoginSuccess)
					{
						bool flag = this.CheckNetState(true);
						if (flag)
						{
							try
							{
								bool aIsNewNote = false;
								if (this._EditMode == FrmEditNote.TEditMode.NewNote)
								{
									aIsNewNote = true;
								}
								flag = this._NoteRemoteObject.EditNote(this._LoginInfo.LoginID, this.tboxtopic.Text.Trim(), this.rtboxbody.Text.Trim(), this.dtpdate.Value.ToString("yyyy-MM-dd"), this.cbbWorkLoad.Text, this.dtpbegintime.Value.ToString("HH:mm:ss"), this.dtpendtime.Value.ToString("HH:mm:ss"), this._OldNoteID, aIsNewNote, this.cbbNoteTypeID.Items[selectedIndex].ToString(), aParaString, aParaCount.ToString(), ref text);
							}
							catch (Exception ex)
							{
								MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							}
							if (flag)
							{
								if (this._EditMode == FrmEditNote.TEditMode.NewNote)
								{
									this._NoteRemoteObject.GetLastNewNoteID(this._LoginInfo.LoginID, this.dtpdate.Value.ToString("yyyy-MM-dd"), ref this._LastNewNoteID, ref text);
									if (this._LastNewNoteID == "0")
									{
										this._LastNewNoteID = "";
									}
								}
								else
								{
									this._LastNewNoteID = this._OldNoteID;
								}
								if (!this.SaveNoteToLocalMdb(this.tboxtopic.Text.Trim(), this.rtboxbody.Text.Trim(), this.dtpdate.Value.ToString("yyyy-MM-dd"), this.cbbWorkLoad.Text, "1", this.dtpbegintime.Value.ToString("HH:mm:ss"), this.dtpendtime.Value.ToString("HH:mm:ss"), this.cbbNoteTypeID.Items[selectedIndex].ToString(), this.cbbProvince.Text + "." + this.cbbCity.Text, this.tboxHospName.Text.Trim(), aParaCount, aArrPara, ref text))
								{
									MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								}
								this.tboxtopic.Clear();
								this.rtboxbody.Clear();
								this.cbbWorkLoad.Text = "8";
								this._NeedRefresh = true;
								if (this._EditMode == FrmEditNote.TEditMode.NewNote)
								{
									if (this.objNoteExpandField.Items.Count != 0)
									{
										this.ClearIuput(this.xtraScrollableControl, this.objNoteExpandField);
									}
									this._objNoteClientCtl.EditNoteCallBack(this._NeedRefresh, this._LastNewNoteID, true);
									if (MessageBox.Show("保存成功，是否继续录入？", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
									{
										base.Close();
									}
								}
							}
							else
							{
								MessageBox.Show("保存日志至服务器失败！" + text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								if (this.SaveNoteToLocalMdb(this.tboxtopic.Text.Trim(), this.rtboxbody.Text.Trim(), this.dtpdate.Value.ToString("yyyy-MM-dd"), this.cbbWorkLoad.Text, "0", this.dtpbegintime.Value.ToString("HH:mm:ss"), this.dtpendtime.Value.ToString("HH:mm:ss"), this.cbbNoteTypeID.Items[selectedIndex].ToString(), this.cbbProvince.Text + "." + this.cbbCity.Text, this.tboxHospName.Text.Trim(), aParaCount, aArrPara, ref text))
								{
									if (this.objNoteExpandField.Items.Count != 0)
									{
										this.ClearIuput(this.xtraScrollableControl, this.objNoteExpandField);
									}
									MessageBox.Show("日志已成功保存至本地缓存表！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
									this.tboxtopic.Clear();
									this.rtboxbody.Clear();
									this.cbbWorkLoad.Text = "8";
								}
								else
								{
									MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								}
							}
						}
						else
						{
							if (this.SaveNoteToLocalMdb(this.tboxtopic.Text.Trim(), this.rtboxbody.Text.Trim(), this.dtpdate.Value.ToString("yyyy-MM-dd"), this.cbbWorkLoad.Text, "0", this.dtpbegintime.Value.ToString("HH:mm:ss"), this.dtpendtime.Value.ToString("HH:mm:ss"), this.cbbNoteTypeID.Items[selectedIndex].ToString(), this.cbbProvince.Text + "." + this.cbbCity.Text, this.tboxHospName.Text.Trim(), aParaCount, aArrPara, ref text))
							{
								if (this.objNoteExpandField.Items.Count != 0)
								{
									this.ClearIuput(this.xtraScrollableControl, this.objNoteExpandField);
								}
								MessageBox.Show("日志已成功保存至本地缓存表！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
								this.tboxtopic.Clear();
								this.rtboxbody.Clear();
								this.cbbWorkLoad.Text = "8";
							}
							else
							{
								MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							}
						}
					}
					if (!this._LoginInfo.LoginSuccess)
					{
						if (this.SaveNoteToLocalMdb(this.tboxtopic.Text.Trim(), this.rtboxbody.Text.Trim(), this.dtpdate.Value.ToString("yyyy-MM-dd"), this.cbbWorkLoad.Text, "0", this.dtpbegintime.Value.ToString("HH:mm:ss"), this.dtpendtime.Value.ToString("HH:mm:ss"), this.cbbNoteTypeID.Items[selectedIndex].ToString(), this.cbbProvince.Text + "." + this.cbbCity.Text, this.tboxHospName.Text.Trim(), aParaCount, aArrPara, ref text))
						{
							if (this.objNoteExpandField.Items.Count != 0)
							{
								this.ClearIuput(this.xtraScrollableControl, this.objNoteExpandField);
							}
							MessageBox.Show("日志已成功保存至本地缓存表！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
							this.tboxtopic.Clear();
							this.rtboxbody.Clear();
							this.cbbWorkLoad.Text = "8";
						}
						else
						{
							MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
					}
					this.AutoBackup();
					if (this._EditMode == FrmEditNote.TEditMode.AlterNote)
					{
						this._objNoteClientCtl.EditNoteCallBack(this._NeedRefresh, this._LastNewNoteID, true);
						base.Close();
					}
				}
			}
		}
		private bool ClearIuput(XtraScrollableControl xtraScrollableControl, ListView objListView)
		{
			for (int i = 0; i < objListView.Items.Count; i++)
			{
				ListViewItem listViewItem = new ListViewItem();
				listViewItem = objListView.Items[i];
				for (int j = 0; j < xtraScrollableControl.Controls.Count; j++)
				{
					if (xtraScrollableControl.Controls[j].Name == listViewItem.SubItems[5].Text)
					{
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) == 0)
						{
							((NumericUpDown)xtraScrollableControl.Controls[j]).Value = 0m;
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) >= 1 && Convert.ToInt32(listViewItem.SubItems[3].Text) <= 7)
						{
							xtraScrollableControl.Controls[j].Text = "";
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) == 8)
						{
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) == 9)
						{
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) == 10)
						{
							((NumericUpDown)xtraScrollableControl.Controls[j]).Value = 0m;
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) == 11)
						{
							((NumericUpDown)xtraScrollableControl.Controls[j]).Value = 0m;
						}
						if (Convert.ToInt32(listViewItem.SubItems[3].Text) >= 12 && Convert.ToInt32(listViewItem.SubItems[3].Text) <= 14)
						{
							((System.Windows.Forms.ComboBox)xtraScrollableControl.Controls[j]).SelectedIndex = -1;
						}
					}
				}
			}
			return true;
		}
		private bool AutoBackup()
		{
			bool result;
			try
			{
				File.Copy(this._sourcefilename, this._destfilename, true);
				result = true;
			}
			catch
			{
				result = false;
			}
			return result;
		}
		private bool GetCity(string aProvinceName)
		{
			string[,] array = new string[0, 0];
			this.cbbCity.Items.Clear();
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "select City from AddressList where Province = '" + aProvinceName + "' order by City";
				array = localAccess.Open(aStrSql);
				int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
				for (int i = 0; i < num; i++)
				{
					this.cbbCity.Items.Add(array[i, 0]);
				}
				localAccess.DisConnect();
				GC.Collect();
				result = true;
			}
			return result;
		}
		private bool GetProvinces()
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "select distinct Province from AddressList";
				array = localAccess.Open(aStrSql);
				int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
				for (int i = 0; i < num; i++)
				{
					this.cbbProvince.Items.Add(array[i, 0]);
				}
				localAccess.DisConnect();
				GC.Collect();
				result = true;
			}
			return result;
		}
		private bool SaveNoteToLocalMdb(string aNoteTopic, string aNoteBody, string aNoteDate, string aWorkLoad, string aUploadFlag, string aBeginTime, string aEndTime, string aTaskID, string aAddress, string aHospital, int aParaCount, string[,] aArrPara, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "保存日志至本地缓存表失败！本地数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				if (aNoteTopic.Trim() == "")
				{
					aErrMsg = "保存日志至本地缓存表失败！日志主题不能为空！";
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					if (aNoteBody.Trim() == "")
					{
						aErrMsg = "保存日志至本地缓存表失败！日志正文不能为空！";
						localAccess.DisConnect();
						GC.Collect();
						result = false;
					}
					else
					{
						if (aNoteDate.Trim() == "")
						{
							aErrMsg = "保存日志至本地缓存表失败！日志日期不能为空！";
							localAccess.DisConnect();
							GC.Collect();
							result = false;
						}
						else
						{
							string aStrSql = string.Concat(new string[]
							{
								"insert into [NoteList]([NoteTopic],[NoteBody],[NoteDate],[WorkLoad],[CreateDate],[CreateTime],[UploadFlag],[BeginTime],[EndTime],[TaskID],[Address],[Hospital]) values('",
								aNoteTopic,
								"','",
								aNoteBody,
								"','",
								aNoteDate,
								"',",
								aWorkLoad,
								",'",
								DateTime.Now.ToString("yyyy-MM-dd"),
								"','",
								DateTime.Now.ToString("HH:mm"),
								"',",
								aUploadFlag,
								",'",
								aBeginTime,
								"','",
								aEndTime,
								"','",
								aTaskID,
								"','",
								aAddress,
								"','",
								aHospital,
								"')"
							});
							int num = localAccess.ExecSQL(aStrSql);
							if (num != 1)
							{
								aErrMsg = localAccess.Message;
								localAccess.DisConnect();
								GC.Collect();
								result = false;
							}
							else
							{
								if (aParaCount != 0)
								{
									aStrSql = "select max(NoteIndex) from NoteList";
									array = localAccess.Open(aStrSql);
									string text = array[0, 0];
									for (int i = 0; i < aParaCount; i++)
									{
										aStrSql = string.Concat(new string[]
										{
											"insert into WorkNotesExpand (NoteIndex,FieldCode,FieldValue) values (",
											text,
											",",
											aArrPara[i, 0],
											",'",
											aArrPara[i, 1],
											"')"
										});
										num = localAccess.ExecSQL(aStrSql);
										if (num != 1)
										{
											aErrMsg = localAccess.Message;
											localAccess.DisConnect();
											GC.Collect();
											result = false;
											return result;
										}
									}
								}
								localAccess.DisConnect();
								GC.Collect();
								result = true;
							}
						}
					}
				}
			}
			return result;
		}
		private void btnCancel_Click(object sender, EventArgs e)
		{
			this._objNoteClientCtl.EditNoteCallBack(false, "", true);
			base.Close();
		}
		private void dtpdate_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				e.Handled = true;
				if (this.tboxtopic.CanFocus)
				{
					this.tboxtopic.Focus();
				}
			}
		}
		private void tboxtopic_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				e.Handled = true;
				if (this.cbbWorkLoad.CanFocus)
				{
					this.cbbWorkLoad.Focus();
				}
			}
		}
		private void cbbWorkLoad_KeyPress(object sender, KeyPressEventArgs e)
		{
			if (e.KeyChar == '\r')
			{
				e.Handled = true;
				if (this.rtboxbody.CanFocus)
				{
					this.rtboxbody.Focus();
				}
			}
		}
		private void FrmEditNote_Shown(object sender, EventArgs e)
		{
			if (this.tboxtopic.CanFocus)
			{
				this.tboxtopic.Focus();
			}
			if (this.cbbWorkLoad.Text == "")
			{
				this.cbbWorkLoad.SelectedIndex = 0;
			}
			if (this._EditMode == FrmEditNote.TEditMode.NewNote)
			{
				this.ReSet();
				if (this._CurrentDate != "")
				{
					try
					{
						this.dtpdate.Value = Convert.ToDateTime(this._CurrentDate);
					}
					catch
					{
						this.dtpdate.Value = DateTime.Now;
					}
				}
			}
			else
			{
				this.tboxtopic.Focus();
			}
			this.CheckNetState(false);
			this.timspy.Enabled = true;
		}
		private bool GetRemoteNoteType(bool bGetLocalFirst)
		{
			string text = "";
			bool result;
			if (this._LoginInfo.LoginSuccess)
			{
				if (!this.CheckNetState(true))
				{
					result = false;
				}
				else
				{
					if (bGetLocalFirst)
					{
						this.GetLocalNoteType(this.cbbNoteTypeID, this.cbbNoteTypeName, this.GetEmpType(), true, ref text);
						if (this.cbbNoteTypeName.Items.Count >= 2)
						{
							result = true;
							return result;
						}
					}
					string[,] array = new string[0, 0];
					this.cbbNoteTypeName.Cursor = Cursors.WaitCursor;
					this.cbbNoteTypeID.Items.Clear();
					this.cbbNoteTypeName.Items.Clear();
					bool flag = this._NoteRemoteObject.CommonQuery("select a.TaskID,a.TaskDesc,isnull(b.EmpType,0) from TaskType a(nolock),Employees b(nolock) where a.EmpType = isnull(b.EmpType,0) and b.EmpID = '" + this._LoginInfo.LoginID + "'", ref array, ref text);
					if (flag)
					{
						int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
						int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
						this.ClearLocalNoteType();
						LocalAccess localAccess = new LocalAccess();
						localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
						if (!localAccess.Connected)
						{
							text = "保存失败！本地数据库连接失败！";
							GC.Collect();
							result = false;
							return result;
						}
						for (int i = 0; i <= num - 1; i++)
						{
							this.cbbNoteTypeID.Items.Add(array[i, 0]);
							this.cbbNoteTypeName.Items.Add(array[i, 1]);
							this.SaveRemoteNoteTypeToLocalMdb(localAccess, array[i, 0], array[i, 1], array[i, 2], ref text);
						}
						localAccess.DisConnect();
						GC.Collect();
						this.cbbNoteTypeID.Items.Add("0");
						this.cbbNoteTypeName.Items.Add("未分类");
						this.cbbNoteTypeName.Cursor = Cursors.Hand;
					}
					this.cbbNoteTypeName.Cursor = Cursors.Hand;
					result = flag;
				}
			}
			else
			{
				this.GetLocalNoteType(this.cbbNoteTypeID, this.cbbNoteTypeName, "", false, ref text);
				result = true;
			}
			return result;
		}
		private string GetEmpType()
		{
			string text = "";
			string[,] array = new string[0, 0];
			string aStrSql = "select EmpType from Employees(nolock) where EmpID = '" + this._LoginInfo.LoginID + "'";
			string result = "";
			if (this._NoteRemoteObject.CommonQuery(aStrSql, ref array, ref text))
			{
				result = array[0, 0];
			}
			return result;
		}
		private bool GetLocalNoteType(System.Windows.Forms.ComboBox objComboBoxTaskID, System.Windows.Forms.ComboBox objComboBoxTaskName, string aEmpType, bool bHasLogin, ref string aErrMsg)
		{
			string[,] array = new string[0, 0];
			this.cbbNoteTypeName.Cursor = Cursors.WaitCursor;
			objComboBoxTaskID.Items.Clear();
			objComboBoxTaskName.Items.Clear();
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				aErrMsg = "数据库连接失败！";
				GC.Collect();
				result = false;
			}
			else
			{
				string text;
				if (bHasLogin)
				{
					text = "select [TaskID],[TaskDesc] from [TaskType] where [EmpType] =" + aEmpType;
				}
				else
				{
					text = "select [TaskID],[TaskDesc] from [TaskType]";
				}
				array = localAccess.Open(text);
				if (localAccess.Message != "")
				{
					aErrMsg = "查询失败！" + localAccess.Message + "\nSQL语句=" + text;
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
					for (int i = 0; i < num; i++)
					{
						objComboBoxTaskID.Items.Add(array[i, 0]);
						objComboBoxTaskName.Items.Add(array[i, 1]);
					}
					objComboBoxTaskID.Items.Add("0");
					objComboBoxTaskName.Items.Add("未分类");
					localAccess.DisConnect();
					GC.Collect();
					this.cbbNoteTypeName.Cursor = Cursors.Hand;
					result = true;
				}
			}
			return result;
		}
		private bool SaveRemoteNoteTypeToLocalMdb(LocalAccess objAccess, string aTaskID, string aTaskDesc, string aEmpType, ref string aErrMsg)
		{
			bool result;
			if (aTaskID.Trim() == "")
			{
				aErrMsg = "保存失败！日志分类代码不能为空！";
				GC.Collect();
				result = false;
			}
			else
			{
				if (aTaskDesc.Trim() == "")
				{
					aErrMsg = "保存失败！日志分类名称不能为空！";
					GC.Collect();
					result = false;
				}
				else
				{
					string aStrSql = string.Concat(new string[]
					{
						"insert into [TaskType]([TaskID],[TaskDesc],[EmpType]) values('",
						aTaskID,
						"','",
						aTaskDesc,
						"',",
						aEmpType,
						")"
					});
					int num = objAccess.ExecSQL(aStrSql);
					if (num != 1)
					{
						aErrMsg = objAccess.Message;
						GC.Collect();
						result = false;
					}
					else
					{
						result = true;
					}
				}
			}
			return result;
		}
		private bool ClearLocalNoteType()
		{
			LocalAccess localAccess = new LocalAccess();
			localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
			bool result;
			if (!localAccess.Connected)
			{
				GC.Collect();
				result = false;
			}
			else
			{
				string aStrSql = "delete from [TaskType]";
				int num = localAccess.ExecSQL(aStrSql);
				if (localAccess.Message != "")
				{
					localAccess.DisConnect();
					GC.Collect();
					result = false;
				}
				else
				{
					localAccess.DisConnect();
					GC.Collect();
					result = (num != 0);
				}
			}
			return result;
		}
		private bool CheckNetState(bool aShowMessage)
		{
			bool flag = false;
			bool result;
			if (!this._LoginInfo.LoginSuccess)
			{
				this.rbbtn1.Checked = false;
				this.rbbtn2.Checked = false;
				this.rbbtn3.Checked = false;
				this.rbbtn4.Checked = false;
				this.rbbtn5.Checked = false;
				this.toolTip.SetToolTip(this.rbbtn1, "脱机模式");
				this.toolTip.SetToolTip(this.rbbtn2, "脱机模式");
				this.toolTip.SetToolTip(this.rbbtn3, "脱机模式");
				this.toolTip.SetToolTip(this.rbbtn4, "脱机模式");
				this.toolTip.SetToolTip(this.rbbtn5, "脱机模式");
				result = false;
			}
			else
			{
				try
				{
					FrmEditNote.QueryPerformanceCounter(ref this.StartCount);
					flag = this._NoteRemoteObject.ConnectionTest();
					if (flag)
					{
						FrmEditNote.QueryPerformanceCounter(ref this.EndCount);
						float num = (float)(this.EndCount - this.StartCount) / (float)this.Frequency;
						if ((double)num <= 0.03)
						{
							this.rbbtn1.Checked = true;
							this.rbbtn2.Checked = true;
							this.rbbtn3.Checked = true;
							this.rbbtn4.Checked = true;
							this.rbbtn5.Checked = true;
							this.toolTip.SetToolTip(this.rbbtn1, "非常好");
							this.toolTip.SetToolTip(this.rbbtn2, "非常好");
							this.toolTip.SetToolTip(this.rbbtn3, "非常好");
							this.toolTip.SetToolTip(this.rbbtn4, "非常好");
							this.toolTip.SetToolTip(this.rbbtn5, "非常好");
						}
						else
						{
							if ((double)num > 0.03 && (double)num <= 0.06)
							{
								this.rbbtn1.Checked = true;
								this.rbbtn2.Checked = true;
								this.rbbtn3.Checked = true;
								this.rbbtn4.Checked = true;
								this.rbbtn5.Checked = false;
								this.toolTip.SetToolTip(this.rbbtn1, "很好");
								this.toolTip.SetToolTip(this.rbbtn2, "很好");
								this.toolTip.SetToolTip(this.rbbtn3, "很好");
								this.toolTip.SetToolTip(this.rbbtn4, "很好");
								this.toolTip.SetToolTip(this.rbbtn5, "很好");
							}
							else
							{
								if ((double)num > 0.06 && (double)num <= 0.1)
								{
									this.rbbtn1.Checked = true;
									this.rbbtn2.Checked = true;
									this.rbbtn3.Checked = true;
									this.rbbtn4.Checked = false;
									this.rbbtn5.Checked = false;
									this.toolTip.SetToolTip(this.rbbtn1, "一般");
									this.toolTip.SetToolTip(this.rbbtn2, "一般");
									this.toolTip.SetToolTip(this.rbbtn3, "一般");
									this.toolTip.SetToolTip(this.rbbtn4, "一般");
									this.toolTip.SetToolTip(this.rbbtn5, "一般");
								}
								else
								{
									if ((double)num > 0.1 && (double)num <= 0.9)
									{
										this.rbbtn1.Checked = true;
										this.rbbtn2.Checked = true;
										this.rbbtn3.Checked = false;
										this.rbbtn4.Checked = false;
										this.rbbtn5.Checked = false;
										this.toolTip.SetToolTip(this.rbbtn1, "弱");
										this.toolTip.SetToolTip(this.rbbtn2, "弱");
										this.toolTip.SetToolTip(this.rbbtn3, "弱");
										this.toolTip.SetToolTip(this.rbbtn4, "弱");
										this.toolTip.SetToolTip(this.rbbtn5, "弱");
									}
									else
									{
										if ((double)num > 0.9)
										{
											this.rbbtn1.Checked = true;
											this.rbbtn2.Checked = false;
											this.rbbtn3.Checked = false;
											this.rbbtn4.Checked = false;
											this.rbbtn5.Checked = false;
											this.toolTip.SetToolTip(this.rbbtn1, "非常弱");
											this.toolTip.SetToolTip(this.rbbtn2, "非常弱");
											this.toolTip.SetToolTip(this.rbbtn3, "非常弱");
											this.toolTip.SetToolTip(this.rbbtn4, "非常弱");
											this.toolTip.SetToolTip(this.rbbtn5, "非常弱");
										}
									}
								}
							}
						}
					}
					else
					{
						this.rbbtn1.Checked = false;
						this.rbbtn2.Checked = false;
						this.rbbtn3.Checked = false;
						this.rbbtn4.Checked = false;
						this.rbbtn5.Checked = false;
						this.toolTip.SetToolTip(this.rbbtn1, "服务器连接失败");
						this.toolTip.SetToolTip(this.rbbtn2, "服务器连接失败");
						this.toolTip.SetToolTip(this.rbbtn3, "服务器连接失败");
						this.toolTip.SetToolTip(this.rbbtn4, "服务器连接失败");
						this.toolTip.SetToolTip(this.rbbtn5, "服务器连接失败");
					}
				}
				catch (Exception ex)
				{
					if (aShowMessage)
					{
						MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
				}
				result = flag;
			}
			return result;
		}
		private void rtboxbody_Enter(object sender, EventArgs e)
		{
			if (this.rtboxbody.Text.Trim() == "")
			{
				this.rtboxbody.Text = this.tboxtopic.Text;
			}
		}
		private void FrmEditNote_MouseDown(object sender, MouseEventArgs e)
		{
			FrmEditNote.ReleaseCapture();
			int hWnd = base.Handle.ToInt32();
			FrmEditNote.SendMessage(hWnd, 274, 61458, 0);
		}
		private void timspy_Tick(object sender, EventArgs e)
		{
			this.CheckNetState(false);
		}
		private void cbbNoteTypeName_DropDown(object sender, EventArgs e)
		{
			if (this.cbbNoteTypeName.Items.Count == 0)
			{
				this.GetRemoteNoteType(true);
			}
		}
		private void ReadClientConfig()
		{
			try
			{
				RegistryKey localMachine = Registry.LocalMachine;
				RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
				object value = registryKey.GetValue("NoteEditFormLeft");
				if (value != null)
				{
					base.Left = Convert.ToInt32(value);
				}
				value = registryKey.GetValue("NoteEditFormTop");
				if (value != null)
				{
					base.Top = Convert.ToInt32(value);
				}
			}
			catch
			{
			}
		}
		private bool SaveClientConfig()
		{
			bool result;
			try
			{
				RegistryKey localMachine = Registry.LocalMachine;
				RegistryKey registryKey = localMachine.OpenSubKey("Software", true);
				RegistryKey registryKey2 = registryKey.CreateSubKey("KSExpert");
				registryKey2.SetValue("NoteEditFormLeft", base.Left.ToString());
				registryKey2.SetValue("NoteEditFormTop", base.Top.ToString());
				registryKey2.Close();
				registryKey.Close();
				result = true;
			}
			catch
			{
				result = false;
			}
			return result;
		}
		private double GetAlarm0()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("Alarm0");
			double result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = 0.0;
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = Convert.ToDouble(value);
			}
			return result;
		}
		private string GetAlarmType()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("AlarmType");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "7";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private double GetAlarm1()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("Alarm1");
			double result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = 0.0;
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = Convert.ToDouble(value);
			}
			return result;
		}
		private int GetWjWshNoteCount(string sBeginDate, string aEndDate, int iGetFlag)
		{
			int result;
			if (this._NoteRemoteObject == null)
			{
				result = 0;
			}
			else
			{
				string[,] array = new string[0, 0];
				try
				{
					if (!this._NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						result = 0;
						return result;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					result = 0;
					return result;
				}
				string text = "";
				bool flag = false;
				try
				{
					if (iGetFlag == 0)
					{
						string text2 = "0";
						flag = this._NoteRemoteObject.CommonQuery(string.Concat(new string[]
						{
							"exec usp_wn_querywjwshnote '",
							sBeginDate,
							"','",
							aEndDate,
							"',",
							text2,
							",",
							iGetFlag.ToString(),
							",'",
							this._LoginInfo.LoginID,
							"'"
						}), ref array, ref text);
					}
					else
					{
						flag = this._NoteRemoteObject.CommonQuery(string.Concat(new string[]
						{
							"exec usp_wn_querywjwshnote '",
							sBeginDate,
							"','",
							aEndDate,
							"',0,",
							iGetFlag.ToString(),
							",'",
							this._LoginInfo.LoginID,
							"'"
						}), ref array, ref text);
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				if (flag)
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					result = num;
				}
				else
				{
					result = 0;
				}
			}
			return result;
		}
		private void FrmEditNote_FormClosing(object sender, FormClosingEventArgs e)
		{
			this.SaveClientConfig();
			this.objNoteExpandField.Dispose();
		}
		private string GetAlarmBeginDate()
		{
			RegistryKey localMachine = Registry.LocalMachine;
			RegistryKey registryKey = localMachine.OpenSubKey("Software\\KSExpert", true);
			object value = registryKey.GetValue("AlarmBeginDate");
			string result;
			if (value == null)
			{
				registryKey.Close();
				localMachine.Close();
				result = "2009-02-09";
			}
			else
			{
				registryKey.Close();
				localMachine.Close();
				result = value.ToString();
			}
			return result;
		}
		private void FrmEditNote_FormClosed(object sender, FormClosedEventArgs e)
		{
			string alarmType = this.GetAlarmType();
			if (!(alarmType == "0"))
			{
				if (!(alarmType == "1"))
				{
					if (!(alarmType == "3"))
					{
						if (!(alarmType == "5"))
						{
							base.Hide();
							if (this._LoginInfo.LoginSuccess)
							{
								int wjWshNoteCount = this.GetWjWshNoteCount(this.GetAlarmBeginDate(), DateTime.Now.AddDays(-this.GetAlarm0()).ToString("yyyy-MM-dd"), 0);
								int wjWshNoteCount2 = this.GetWjWshNoteCount(this.GetAlarmBeginDate(), DateTime.Now.AddDays(-this.GetAlarm1()).ToString("yyyy-MM-dd"), 1);
								if (wjWshNoteCount != 0 || wjWshNoteCount2 != 0)
								{
									if (wjWshNoteCount != 0 && wjWshNoteCount2 == 0)
									{
										if (new FrmNoteAlarm
										{
											lbMsg = 
											{
												Text = "您有 " + wjWshNoteCount.ToString() + " 天日志没有交，请抓紧时间补交！"
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									if (wjWshNoteCount == 0 && wjWshNoteCount2 != 0)
									{
										if (new FrmNoteAlarm
										{
											lbMsg = 
											{
												Text = "您有 " + wjWshNoteCount2.ToString() + " 个日志明细没有审核，请抓紧时间审核！"
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									if (wjWshNoteCount != 0 && wjWshNoteCount2 != 0)
									{
										if (new FrmNoteAlarm
										{
											lbMsg = 
											{
												Text = string.Concat(new string[]
												{
													"您有 ",
													wjWshNoteCount.ToString(),
													" 天日志没有交、有 ",
													wjWshNoteCount2.ToString(),
													" 个日志明细没有审核！"
												})
											}
										}.ShowDialog() == DialogResult.Cancel)
										{
											return;
										}
									}
									try
									{
										if (!this._NoteRemoteObject.ConnectionTest())
										{
											MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
											return;
										}
									}
									catch (Exception ex)
									{
										MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
										return;
									}
									FrmViewWjwsh frmViewWjwsh = new FrmViewWjwsh();
									frmViewWjwsh.LoginInfo = this._LoginInfo;
									frmViewWjwsh.NoteRemoteObject = this._NoteRemoteObject;
									frmViewWjwsh.ShowDialog();
									frmViewWjwsh.Dispose();
								}
							}
						}
					}
				}
			}
		}
		private void ReSet()
		{
			this.iOldSelectedIndex = -1;
			this.AutoChangeSize(0, 0, false);
			this.xtraScrollableControl.Controls.Clear();
			this.objNoteExpandField.Items.Clear();
			this.xtraTabPage1.PageVisible = true;
			this.xtraTabPage2.PageVisible = false;
		}
		private void btnReferesh_Click(object sender, EventArgs e)
		{
			this.ReSet();
			this.Refresh();
			this.btnReferesh.Cursor = Cursors.WaitCursor;
			this.GetRemoteNoteType(false);
			this.btnReferesh.Cursor = Cursors.Hand;
		}
		private void AutoChangeSize(int iPriorEditCrlTop, int iPriorEditCrlHeight, bool ChangeNew)
		{
		}
		private void ShowExpandFields()
		{
			this.ReSet();
			if (this.cbbNoteTypeName.SelectedIndex != -1)
			{
				string[,] array = new string[0, 0];
				string text = "";
				int num = 0;
				int num2 = 0;
				string str = this.cbbNoteTypeID.Items[this.cbbNoteTypeName.SelectedIndex].ToString();
				if (!this._LoginInfo.LoginSuccess)
				{
					LocalAccess localAccess = new LocalAccess();
					localAccess.Connect(NoteRemote.GetNoteClientStartPath() + "\\LocalWorkNotes.mdb");
					if (!localAccess.Connected)
					{
						text = "本地数据库连接失败！";
						GC.Collect();
						return;
					}
					string text2 = "select FieldCode,TaskID,FieldName,FieldType,NullAble from ExpandFieldDefine where TaskID = " + str;
					array = localAccess.Open(text2);
					if (localAccess.Message != "")
					{
						text = "查询失败！" + localAccess.Message + "\nSQL语句=" + text2;
						localAccess.DisConnect();
						array = null;
						GC.Collect();
						return;
					}
					int num3 = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					int num4 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
					if (num3 == 0)
					{
						localAccess.DisConnect();
						array = null;
						GC.Collect();
						return;
					}
					this.xtraTabPage1.PageVisible = false;
					this.xtraTabPage2.PageVisible = true;
					int num5 = 0;
					for (int i = 0; i <= num3 - 1; i++)
					{
						ListViewItem listViewItem = new ListViewItem();
						listViewItem.Text = array[i, 0];
						listViewItem.SubItems.Add(array[i, 1]);
						listViewItem.SubItems.Add(array[i, 2]);
						listViewItem.SubItems.Add(array[i, 3]);
						listViewItem.SubItems.Add(array[i, 4]);
						listViewItem.SubItems.Add("");
						this.objNoteExpandField.Items.Add(listViewItem);
						Label label = new Label();
						label.Name = "lbExpand" + i.ToString();
						label.Text = array[i, 2];
						label.Parent = this.xtraScrollableControl;
						this.xtraScrollableControl.Controls.Add(label);
						label.Left = 2;
						label.Top = 10 + i * 26;
						label.Font = this.lbNoteDate.Font;
						label.ForeColor = System.Drawing.Color.White;
						if (label.Width >= num5)
						{
							num5 = label.Width;
						}
					}
					num5 += 2;
					for (int i = 0; i <= num3 - 1; i++)
					{
						switch (Convert.ToInt32(array[i, 3]))
						{
						case 0:
						{
							object obj = new NumericUpDown();
							((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
							((NumericUpDown)obj).Minimum = -99999999m;
							((NumericUpDown)obj).Maximum = 99999999m;
							((NumericUpDown)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((NumericUpDown)obj).Height;
							((NumericUpDown)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((NumericUpDown)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
							break;
						}
						case 1:
						{
							object obj = new TextBox();
							((TextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
							((TextBox)obj).MaxLength = 16;
							((TextBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((TextBox)obj).Height;
							((TextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((TextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((TextBox)obj);
							break;
						}
						case 2:
						{
							object obj = new TextBox();
							((TextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
							((TextBox)obj).MaxLength = 32;
							((TextBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((TextBox)obj).Height;
							((TextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((TextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((TextBox)obj);
							break;
						}
						case 3:
						{
							object obj = new TextBox();
							((TextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
							((TextBox)obj).MaxLength = 64;
							((TextBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((TextBox)obj).Height;
							((TextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((TextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((TextBox)obj);
							break;
						}
						case 4:
						{
							object obj = new TextBox();
							((TextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
							((TextBox)obj).MaxLength = 128;
							((TextBox)obj).Left = num5;
							((TextBox)obj).Height = 60;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((TextBox)obj).Height;
							((TextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((TextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((TextBox)obj);
							break;
						}
						case 5:
						{
							object obj = new TextBox();
							((TextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
							((TextBox)obj).MaxLength = 255;
							((TextBox)obj).Left = num5;
							((TextBox)obj).Height = 60;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((TextBox)obj).Height;
							((TextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((TextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((TextBox)obj);
							break;
						}
						case 6:
						{
							object obj = new RichTextBox();
							((RichTextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((RichTextBox)obj).Name;
							((RichTextBox)obj).MaxLength = 1024;
							((RichTextBox)obj).Left = num5;
							((RichTextBox)obj).Height = 60;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((RichTextBox)obj).Height;
							((RichTextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((RichTextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((RichTextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((RichTextBox)obj);
							break;
						}
						case 7:
						{
							object obj = new RichTextBox();
							((RichTextBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((RichTextBox)obj).Name;
							((RichTextBox)obj).MaxLength = 2048;
							((RichTextBox)obj).Left = num5;
							((RichTextBox)obj).Height = 60;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((RichTextBox)obj).Height;
							((RichTextBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((RichTextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((RichTextBox)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((RichTextBox)obj);
							break;
						}
						case 8:
						{
							object obj = new DateTimePicker();
							((DateTimePicker)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((DateTimePicker)obj).Name;
							((DateTimePicker)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((DateTimePicker)obj).Height;
							((DateTimePicker)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((DateTimePicker)obj).Value = this.dtpdate.Value;
							((DateTimePicker)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((DateTimePicker)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((DateTimePicker)obj);
							break;
						}
						case 9:
						{
							object obj = new DateTimePicker();
							((DateTimePicker)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((DateTimePicker)obj).Name;
							((DateTimePicker)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((DateTimePicker)obj).Height;
							((DateTimePicker)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((DateTimePicker)obj).Format = DateTimePickerFormat.Time;
							((DateTimePicker)obj).Value = Convert.ToDateTime("00:00:00");
							((DateTimePicker)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((DateTimePicker)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((DateTimePicker)obj);
							break;
						}
						case 10:
						{
							object obj = new NumericUpDown();
							((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
							((NumericUpDown)obj).Minimum = -99999999m;
							((NumericUpDown)obj).Maximum = 99999999m;
							((NumericUpDown)obj).DecimalPlaces = 2;
							((NumericUpDown)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((NumericUpDown)obj).Height;
							((NumericUpDown)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((NumericUpDown)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
							break;
						}
						case 11:
						{
							object obj = new NumericUpDown();
							((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
							((NumericUpDown)obj).Minimum = -99999999m;
							((NumericUpDown)obj).Maximum = 99999999m;
							((NumericUpDown)obj).DecimalPlaces = 4;
							((NumericUpDown)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((NumericUpDown)obj).Height;
							((NumericUpDown)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((NumericUpDown)obj).Parent = this.xtraScrollableControl;
							this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
							break;
						}
						case 12:
						{
							object obj = new System.Windows.Forms.ComboBox();
							((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
							((System.Windows.Forms.ComboBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((System.Windows.Forms.ComboBox)obj).Height;
							((System.Windows.Forms.ComboBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期一");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期二");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期三");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期四");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期五");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期六");
							((System.Windows.Forms.ComboBox)obj).Items.Add("星期日");
							DayOfWeek dayOfWeek = DateTime.Now.DayOfWeek;
							string value = "";
							switch (dayOfWeek)
							{
							case DayOfWeek.Sunday:
								value = "星期日";
								break;
							case DayOfWeek.Monday:
								value = "星期一";
								break;
							case DayOfWeek.Tuesday:
								value = "星期二";
								break;
							case DayOfWeek.Wednesday:
								value = "星期三";
								break;
							case DayOfWeek.Thursday:
								value = "星期四";
								break;
							case DayOfWeek.Friday:
								value = "星期五";
								break;
							case DayOfWeek.Saturday:
								value = "星期六";
								break;
							}
							((System.Windows.Forms.ComboBox)obj).SelectedIndex = ((System.Windows.Forms.ComboBox)obj).Items.IndexOf(value);
							this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
							break;
						}
						case 13:
						{
							object obj = new System.Windows.Forms.ComboBox();
							((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
							((System.Windows.Forms.ComboBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((System.Windows.Forms.ComboBox)obj).Height;
							((System.Windows.Forms.ComboBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
							if (this._LoginInfo.LoginSuccess)
							{
								this.GetUserList((System.Windows.Forms.ComboBox)obj, "");
							}
							((System.Windows.Forms.ComboBox)obj).DropDownStyle = ComboBoxStyle.DropDownList;
							this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
							break;
						}
						case 14:
						{
							object obj = new System.Windows.Forms.ComboBox();
							((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
							this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
							((System.Windows.Forms.ComboBox)obj).Left = num5;
							if (i == 0)
							{
								num = 6;
							}
							else
							{
								num = num + num2 + 6;
							}
							num2 = ((System.Windows.Forms.ComboBox)obj).Height;
							((System.Windows.Forms.ComboBox)obj).Top = num;
							Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
							if (array2.Length != 0)
							{
								array2[0].Top = num + 2;
							}
							((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
							((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
							if (this._LoginInfo.LoginSuccess)
							{
								this.GetUserList((System.Windows.Forms.ComboBox)obj, this._LoginInfo.GroupID);
							}
							((System.Windows.Forms.ComboBox)obj).DropDownStyle = ComboBoxStyle.DropDownList;
							this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
							break;
						}
						}
					}
					localAccess.DisConnect();
					array = null;
					GC.Collect();
				}
				if (this._LoginInfo.LoginSuccess)
				{
					try
					{
						bool flag = this._NoteRemoteObject.CommonQuery("select FieldCode,TaskID,FieldName,FieldType,NullAble from ExpandFieldDefine(nolock) where TaskID = " + str, ref array, ref text);
						if (flag)
						{
							int num3 = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
							int num4 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
							if (num3 != 0)
							{
								this.xtraTabPage1.PageVisible = false;
								this.xtraTabPage2.PageVisible = true;
								int num5 = 0;
								for (int i = 0; i <= num3 - 1; i++)
								{
									ListViewItem listViewItem = new ListViewItem();
									listViewItem.Text = array[i, 0];
									listViewItem.SubItems.Add(array[i, 1]);
									listViewItem.SubItems.Add(array[i, 2]);
									listViewItem.SubItems.Add(array[i, 3]);
									listViewItem.SubItems.Add(array[i, 4]);
									listViewItem.SubItems.Add("");
									this.objNoteExpandField.Items.Add(listViewItem);
									Label label = new Label();
									label.Name = "lbExpand" + i.ToString();
									label.Text = array[i, 2];
									label.Parent = this.xtraScrollableControl;
									this.xtraScrollableControl.Controls.Add(label);
									label.Left = 2;
									label.Font = this.lbNoteDate.Font;
									label.ForeColor = System.Drawing.Color.White;
									if (label.Width >= num5)
									{
										num5 = label.Width;
									}
								}
								num5 += 2;
								for (int i = 0; i <= num3 - 1; i++)
								{
									switch (Convert.ToInt32(array[i, 3]))
									{
									case 0:
									{
										object obj = new NumericUpDown();
										((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
										((NumericUpDown)obj).Minimum = -99999999m;
										((NumericUpDown)obj).Maximum = 99999999m;
										((NumericUpDown)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((NumericUpDown)obj).Height;
										((NumericUpDown)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((NumericUpDown)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
										break;
									}
									case 1:
									{
										object obj = new TextBox();
										((TextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
										((TextBox)obj).MaxLength = 16;
										((TextBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((TextBox)obj).Height;
										((TextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((TextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((TextBox)obj);
										break;
									}
									case 2:
									{
										object obj = new TextBox();
										((TextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
										((TextBox)obj).MaxLength = 32;
										((TextBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((TextBox)obj).Height;
										((TextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((TextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((TextBox)obj);
										break;
									}
									case 3:
									{
										object obj = new TextBox();
										((TextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
										((TextBox)obj).MaxLength = 64;
										((TextBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((TextBox)obj).Height;
										((TextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((TextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((TextBox)obj);
										break;
									}
									case 4:
									{
										object obj = new TextBox();
										((TextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
										((TextBox)obj).MaxLength = 128;
										((TextBox)obj).Left = num5;
										((TextBox)obj).Height = 60;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((TextBox)obj).Height;
										((TextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((TextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((TextBox)obj);
										break;
									}
									case 5:
									{
										object obj = new TextBox();
										((TextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((TextBox)obj).Name;
										((TextBox)obj).MaxLength = 255;
										((TextBox)obj).Left = num5;
										((TextBox)obj).Height = 60;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((TextBox)obj).Height;
										((TextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((TextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((TextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((TextBox)obj);
										break;
									}
									case 6:
									{
										object obj = new RichTextBox();
										((RichTextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((RichTextBox)obj).Name;
										((RichTextBox)obj).MaxLength = 1024;
										((RichTextBox)obj).Left = num5;
										((RichTextBox)obj).Height = 60;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((RichTextBox)obj).Height;
										((RichTextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((RichTextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((RichTextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((RichTextBox)obj);
										break;
									}
									case 7:
									{
										object obj = new RichTextBox();
										((RichTextBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((RichTextBox)obj).Name;
										((RichTextBox)obj).MaxLength = 2048;
										((RichTextBox)obj).Left = num5;
										((RichTextBox)obj).Height = 60;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((RichTextBox)obj).Height;
										((RichTextBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((RichTextBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((RichTextBox)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((RichTextBox)obj);
										break;
									}
									case 8:
									{
										object obj = new DateTimePicker();
										((DateTimePicker)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((DateTimePicker)obj).Name;
										((DateTimePicker)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((DateTimePicker)obj).Height;
										((DateTimePicker)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((DateTimePicker)obj).Value = this.dtpdate.Value;
										((DateTimePicker)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((DateTimePicker)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((DateTimePicker)obj);
										break;
									}
									case 9:
									{
										object obj = new DateTimePicker();
										((DateTimePicker)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((DateTimePicker)obj).Name;
										((DateTimePicker)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((DateTimePicker)obj).Height;
										((DateTimePicker)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((DateTimePicker)obj).Format = DateTimePickerFormat.Time;
										((DateTimePicker)obj).Value = Convert.ToDateTime("00:00:00");
										((DateTimePicker)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((DateTimePicker)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((DateTimePicker)obj);
										break;
									}
									case 10:
									{
										object obj = new NumericUpDown();
										((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
										((NumericUpDown)obj).Minimum = -99999999m;
										((NumericUpDown)obj).Maximum = 99999999m;
										((NumericUpDown)obj).DecimalPlaces = 2;
										((NumericUpDown)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((NumericUpDown)obj).Height;
										((NumericUpDown)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((NumericUpDown)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
										break;
									}
									case 11:
									{
										object obj = new NumericUpDown();
										((NumericUpDown)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((NumericUpDown)obj).Name;
										((NumericUpDown)obj).Minimum = -99999999m;
										((NumericUpDown)obj).Maximum = 99999999m;
										((NumericUpDown)obj).DecimalPlaces = 4;
										((NumericUpDown)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((NumericUpDown)obj).Height;
										((NumericUpDown)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										this.AutoChangeSize(num, num2, true);
										((NumericUpDown)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((NumericUpDown)obj).Parent = this.xtraScrollableControl;
										this.xtraScrollableControl.Controls.Add((NumericUpDown)obj);
										break;
									}
									case 12:
									{
										object obj = new System.Windows.Forms.ComboBox();
										((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
										((System.Windows.Forms.ComboBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((System.Windows.Forms.ComboBox)obj).Height;
										((System.Windows.Forms.ComboBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期一");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期二");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期三");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期四");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期五");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期六");
										((System.Windows.Forms.ComboBox)obj).Items.Add("星期日");
										DayOfWeek dayOfWeek = DateTime.Now.DayOfWeek;
										string value = "";
										switch (dayOfWeek)
										{
										case DayOfWeek.Sunday:
											value = "星期日";
											break;
										case DayOfWeek.Monday:
											value = "星期一";
											break;
										case DayOfWeek.Tuesday:
											value = "星期二";
											break;
										case DayOfWeek.Wednesday:
											value = "星期三";
											break;
										case DayOfWeek.Thursday:
											value = "星期四";
											break;
										case DayOfWeek.Friday:
											value = "星期五";
											break;
										case DayOfWeek.Saturday:
											value = "星期六";
											break;
										}
										((System.Windows.Forms.ComboBox)obj).SelectedIndex = ((System.Windows.Forms.ComboBox)obj).Items.IndexOf(value);
										((System.Windows.Forms.ComboBox)obj).DropDownStyle = ComboBoxStyle.DropDownList;
										this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
										break;
									}
									case 13:
									{
										object obj = new System.Windows.Forms.ComboBox();
										((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
										((System.Windows.Forms.ComboBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((System.Windows.Forms.ComboBox)obj).Height;
										((System.Windows.Forms.ComboBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
										if (this._LoginInfo.LoginSuccess)
										{
											this.GetUserList((System.Windows.Forms.ComboBox)obj, "");
										}
										((System.Windows.Forms.ComboBox)obj).DropDownStyle = ComboBoxStyle.DropDownList;
										this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
										break;
									}
									case 14:
									{
										object obj = new System.Windows.Forms.ComboBox();
										((System.Windows.Forms.ComboBox)obj).Name = "editControlExpand" + i.ToString();
										this.objNoteExpandField.Items[i].SubItems[5].Text = ((System.Windows.Forms.ComboBox)obj).Name;
										((System.Windows.Forms.ComboBox)obj).Left = num5;
										if (i == 0)
										{
											num = 6;
										}
										else
										{
											num = num + num2 + 6;
										}
										num2 = ((System.Windows.Forms.ComboBox)obj).Height;
										((System.Windows.Forms.ComboBox)obj).Top = num;
										Control[] array2 = this.xtraScrollableControl.Controls.Find("lbExpand" + i.ToString(), false);
										if (array2.Length != 0)
										{
											array2[0].Top = num + 2;
										}
										((System.Windows.Forms.ComboBox)obj).Width = this.xtraScrollableControl.Width - num5 - this.iLabelAndCtlWidth - this.iEditControlWidthOffSet;
										((System.Windows.Forms.ComboBox)obj).Parent = this.xtraScrollableControl;
										if (this._LoginInfo.LoginSuccess)
										{
											this.GetUserList((System.Windows.Forms.ComboBox)obj, this._LoginInfo.GroupID);
										}
										((System.Windows.Forms.ComboBox)obj).DropDownStyle = ComboBoxStyle.DropDownList;
										this.xtraScrollableControl.Controls.Add((System.Windows.Forms.ComboBox)obj);
										break;
									}
									}
								}
							}
						}
						else
						{
							MessageBox.Show(text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						}
					}
					catch (Exception ex)
					{
						MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					}
				}
			}
		}
		private void GetUserList(System.Windows.Forms.ComboBox objEmpNameComboBox, string aGroupID)
		{
			if (this._LoginInfo.LoginSuccess)
			{
				try
				{
					if (!this._NoteRemoteObject.ConnectionTest())
					{
						MessageBox.Show("远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
						return;
					}
				}
				catch (Exception ex)
				{
					MessageBox.Show(ex.Message + "远程连接已断开，请重新连接后再试！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
					return;
				}
				string[,] array = new string[0, 0];
				string text = "";
				if (aGroupID == "")
				{
					bool flag = this._NoteRemoteObject.CommonQuery("select EmpID,EmpName from Employees(nolock) where PurID not in(0) and RecordState = 0", ref array, ref text);
				}
				else
				{
					if (this._LoginInfo.PurviewID == "3" || this._LoginInfo.PurviewID == "4")
					{
						bool flag = this._NoteRemoteObject.CommonQuery("select EmpID,EmpName from Employees(nolock) where PurID not in(0) and RecordState = 0", ref array, ref text);
					}
					else
					{
						bool flag = this._NoteRemoteObject.CommonQuery("select 1 from WorkGroup where ParentGroupID = " + aGroupID, ref array, ref text);
						if (array.Length != 0)
						{
							flag = this._NoteRemoteObject.CommonQuery(string.Concat(new string[]
							{
								"select EmpID,EmpName from Employees(nolock) where PurID not in(0) and RecordState = 0 and GroupID = ",
								aGroupID,
								" union all select EmpID,EmpName from Employees(nolock) where PurID not in(0) and RecordState = 0 and GroupID in(select GroupID from WorkGroup where ParentGroupID = ",
								aGroupID,
								") "
							}), ref array, ref text);
						}
						else
						{
							flag = this._NoteRemoteObject.CommonQuery("select EmpID,EmpName from Employees(nolock) where PurID not in(0) and RecordState = 0 and GroupID = " + aGroupID, ref array, ref text);
						}
					}
				}
				if (text.Trim() != "")
				{
					MessageBox.Show("获取人员列表失败！" + text, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
				}
				else
				{
					int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
					objEmpNameComboBox.Items.Clear();
					System.Windows.Forms.ComboBox comboBox = new System.Windows.Forms.ComboBox();
					for (int i = 0; i < num; i++)
					{
						comboBox.Items.Add(array[i, 0]);
						objEmpNameComboBox.Items.Add(array[i, 1]);
					}
					objEmpNameComboBox.Tag = comboBox;
				}
			}
		}
		private void cbbNoteTypeName_DropDownClosed(object sender, EventArgs e)
		{
			if (this.iOldSelectedIndex != this.cbbNoteTypeName.SelectedIndex)
			{
				this.ShowExpandFields();
				this.iOldSelectedIndex = this.cbbNoteTypeName.SelectedIndex;
				if (!(this._OldNoteID.Trim() == ""))
				{
					string text = "";
					if (this.objNoteExpandField.Items.Count != 0)
					{
						string[,] array = new string[0, 0];
						bool flag = this._NoteRemoteObject.CommonQuery("select FieldCode,FieldValue from WorkNotesExpand(nolock) where NoteID= " + this._OldNoteID, ref array, ref text);
						if (flag)
						{
							int num = array.GetUpperBound(0) - array.GetLowerBound(0) + 1;
							int num2 = array.GetUpperBound(1) - array.GetLowerBound(1) + 1;
							for (int i = 0; i < num; i++)
							{
								for (int j = 0; j < this.objNoteExpandField.Items.Count; j++)
								{
									ListViewItem listViewItem = new ListViewItem();
									listViewItem = this.objNoteExpandField.Items[j];
									if (listViewItem.SubItems[0].Text == array[i, 0])
									{
										string text2 = listViewItem.SubItems[5].Text;
										Control[] array2 = this.xtraScrollableControl.Controls.Find(text2, false);
										if (array2.Length != 0)
										{
											if (array2[0] is NumericUpDown)
											{
												decimal value = 0m;
												decimal.TryParse(array[i, 1], out value);
												((NumericUpDown)array2[0]).Value = value;
											}
											if (array2[0] is TextBox)
											{
												((TextBox)array2[0]).Text = array[i, 1];
											}
											if (array2[0] is DateTimePicker)
											{
												DateTime value2;
												DateTime.TryParse(array[i, 1], out value2);
												((DateTimePicker)array2[0]).Value = value2;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		private void cbbNoteTypeName_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.cbbProvince.Items.Clear();
			this.cbbCity.Items.Clear();
			this.cbbNoteTypeName_DropDownClosed(sender, e);
			if (this.cbbNoteTypeName.Text.Trim() == "现场支持")
			{
				this.cbbProvince.Enabled = true;
				this.cbbCity.Enabled = true;
				this.tboxHospName.Enabled = true;
				this.cbbProvince.Focus();
				this.tboxHospName.BackColor = System.Drawing.Color.White;
				this.GetProvinces();
			}
			else
			{
				this.cbbProvince.Enabled = false;
				this.cbbCity.Enabled = false;
				this.tboxHospName.Enabled = false;
				this.tboxHospName.BackColor = System.Drawing.Color.Gainsboro;
			}
		}
		private void groupBoxMain_Enter(object sender, EventArgs e)
		{
		}
		private void cbbProvince_SelectedIndexChanged(object sender, EventArgs e)
		{
			this.GetCity(this.cbbProvince.Text);
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(FrmEditNote));
			this.groupBoxMain = new GroupBox();
			this.cbbCity = new System.Windows.Forms.ComboBox();
			this.cbbProvince = new System.Windows.Forms.ComboBox();
			this.tboxHospName = new TextBox();
			this.label6 = new Label();
			this.label2 = new Label();
			this.xtraTabControl = new XtraTabControl();
			this.xtraTabPage1 = new XtraTabPage();
			this.rtboxbody = new RichTextBox();
			this.xtraTabPage2 = new XtraTabPage();
			this.xtraScrollableControl = new XtraScrollableControl();
			this.btnReferesh = new Button();
			this.imageList = new ImageList(this.components);
			this.label7 = new Label();
			this.cbbNoteTypeName = new System.Windows.Forms.ComboBox();
			this.panel5 = new Panel();
			this.rbbtn5 = new RadioButton();
			this.panel4 = new Panel();
			this.rbbtn4 = new RadioButton();
			this.panel3 = new Panel();
			this.rbbtn3 = new RadioButton();
			this.panel2 = new Panel();
			this.rbbtn2 = new RadioButton();
			this.panel1 = new Panel();
			this.rbbtn1 = new RadioButton();
			this.lbMsg = new Label();
			this.label5 = new Label();
			this.label4 = new Label();
			this.dtpbegintime = new DateTimePicker();
			this.dtpendtime = new DateTimePicker();
			this.pboxBody = new PictureBox();
			this.pboxWorkLoad = new PictureBox();
			this.pboxTopic = new PictureBox();
			this.pboxDate = new PictureBox();
			this.cbbWorkLoad = new System.Windows.Forms.ComboBox();
			this.label3 = new Label();
			this.btnCancel = new Button();
			this.btnSave = new Button();
			this.dtpdate = new DateTimePicker();
			this.lbNoteDate = new Label();
			this.tboxtopic = new TextBox();
			this.label1 = new Label();
			this.toolTip = new ToolTip(this.components);
			this.timspy = new Timer(this.components);
			this.toolTipEx = new ToolTip(this.components);
			this.cbbNoteTypeID = new System.Windows.Forms.ComboBox();
			this.groupBoxMain.SuspendLayout();
			((ISupportInitialize)this.xtraTabControl).BeginInit();
			this.xtraTabControl.SuspendLayout();
			this.xtraTabPage1.SuspendLayout();
			this.xtraTabPage2.SuspendLayout();
			this.panel5.SuspendLayout();
			this.panel4.SuspendLayout();
			this.panel3.SuspendLayout();
			this.panel2.SuspendLayout();
			this.panel1.SuspendLayout();
			((ISupportInitialize)this.pboxBody).BeginInit();
			((ISupportInitialize)this.pboxWorkLoad).BeginInit();
			((ISupportInitialize)this.pboxTopic).BeginInit();
			((ISupportInitialize)this.pboxDate).BeginInit();
			base.SuspendLayout();
			this.groupBoxMain.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.groupBoxMain.Controls.Add(this.cbbCity);
			this.groupBoxMain.Controls.Add(this.cbbProvince);
			this.groupBoxMain.Controls.Add(this.tboxHospName);
			this.groupBoxMain.Controls.Add(this.label6);
			this.groupBoxMain.Controls.Add(this.label2);
			this.groupBoxMain.Controls.Add(this.xtraTabControl);
			this.groupBoxMain.Controls.Add(this.btnReferesh);
			this.groupBoxMain.Controls.Add(this.label7);
			this.groupBoxMain.Controls.Add(this.cbbNoteTypeName);
			this.groupBoxMain.Controls.Add(this.panel5);
			this.groupBoxMain.Controls.Add(this.panel4);
			this.groupBoxMain.Controls.Add(this.panel3);
			this.groupBoxMain.Controls.Add(this.panel2);
			this.groupBoxMain.Controls.Add(this.panel1);
			this.groupBoxMain.Controls.Add(this.lbMsg);
			this.groupBoxMain.Controls.Add(this.label5);
			this.groupBoxMain.Controls.Add(this.label4);
			this.groupBoxMain.Controls.Add(this.dtpbegintime);
			this.groupBoxMain.Controls.Add(this.dtpendtime);
			this.groupBoxMain.Controls.Add(this.pboxBody);
			this.groupBoxMain.Controls.Add(this.pboxWorkLoad);
			this.groupBoxMain.Controls.Add(this.pboxTopic);
			this.groupBoxMain.Controls.Add(this.pboxDate);
			this.groupBoxMain.Controls.Add(this.cbbWorkLoad);
			this.groupBoxMain.Controls.Add(this.label3);
			this.groupBoxMain.Controls.Add(this.btnCancel);
			this.groupBoxMain.Controls.Add(this.btnSave);
			this.groupBoxMain.Controls.Add(this.dtpdate);
			this.groupBoxMain.Controls.Add(this.lbNoteDate);
			this.groupBoxMain.Controls.Add(this.tboxtopic);
			this.groupBoxMain.Controls.Add(this.label1);
			this.groupBoxMain.Cursor = Cursors.Default;
			this.groupBoxMain.Font = new System.Drawing.Font("宋体", 10.5f);
			this.groupBoxMain.ForeColor = System.Drawing.Color.White;
			this.groupBoxMain.Location = new System.Drawing.Point(13, 19);
			this.groupBoxMain.Name = "groupBoxMain";
			this.groupBoxMain.Size = new System.Drawing.Size(642, 450);
			this.groupBoxMain.TabIndex = 10;
			this.groupBoxMain.TabStop = false;
			this.groupBoxMain.Text = "日志编辑器 - 今天是2009年2月9日，星期一";
			this.groupBoxMain.Enter += new EventHandler(this.groupBoxMain_Enter);
			this.cbbCity.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbCity.FormattingEnabled = true;
			this.cbbCity.Location = new System.Drawing.Point(479, 140);
			this.cbbCity.Name = "cbbCity";
			this.cbbCity.Size = new System.Drawing.Size(151, 22);
			this.cbbCity.TabIndex = 52;
			this.cbbProvince.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbProvince.FormattingEnabled = true;
			this.cbbProvince.Location = new System.Drawing.Point(391, 140);
			this.cbbProvince.Name = "cbbProvince";
			this.cbbProvince.Size = new System.Drawing.Size(85, 22);
			this.cbbProvince.TabIndex = 51;
			this.cbbProvince.SelectedIndexChanged += new EventHandler(this.cbbProvince_SelectedIndexChanged);
			this.tboxHospName.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.tboxHospName.Location = new System.Drawing.Point(126, 183);
			this.tboxHospName.MaxLength = 200;
			this.tboxHospName.Name = "tboxHospName";
			this.tboxHospName.Size = new System.Drawing.Size(505, 23);
			this.tboxHospName.TabIndex = 49;
			this.label6.AutoSize = true;
			this.label6.ForeColor = System.Drawing.Color.White;
			this.label6.Location = new System.Drawing.Point(57, 186);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(63, 14);
			this.label6.TabIndex = 50;
			this.label6.Text = "医院名称";
			this.label2.AutoSize = true;
			this.label2.ForeColor = System.Drawing.Color.White;
			this.label2.Location = new System.Drawing.Point(322, 143);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(63, 14);
			this.label2.TabIndex = 48;
			this.label2.Text = "地    点";
			this.xtraTabControl.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.xtraTabControl.Location = new System.Drawing.Point(63, 223);
			this.xtraTabControl.Name = "xtraTabControl";
			this.xtraTabControl.SelectedTabPage = this.xtraTabPage1;
			this.xtraTabControl.Size = new System.Drawing.Size(573, 191);
			this.xtraTabControl.TabIndex = 46;
			this.xtraTabControl.TabPages.AddRange(new XtraTabPage[]
			{
				this.xtraTabPage1,
				this.xtraTabPage2
			});
			this.xtraTabPage1.Controls.Add(this.rtboxbody);
			this.xtraTabPage1.Font = new System.Drawing.Font("宋体", 10.5f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134);
			this.xtraTabPage1.Name = "xtraTabPage1";
			this.xtraTabPage1.Size = new System.Drawing.Size(566, 161);
			this.xtraTabPage1.Text = "简单日志信息";
			this.rtboxbody.Dock = DockStyle.Fill;
			this.rtboxbody.Location = new System.Drawing.Point(0, 0);
			this.rtboxbody.MaxLength = 3600;
			this.rtboxbody.Name = "rtboxbody";
			this.rtboxbody.Size = new System.Drawing.Size(566, 161);
			this.rtboxbody.TabIndex = 4;
			this.rtboxbody.Text = "";
			this.xtraTabPage2.Controls.Add(this.xtraScrollableControl);
			this.xtraTabPage2.Name = "xtraTabPage2";
			this.xtraTabPage2.Size = new System.Drawing.Size(566, 161);
			this.xtraTabPage2.Text = "详细日志信息";
			this.xtraScrollableControl.Appearance.BackColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.xtraScrollableControl.Appearance.Options.UseBackColor = true;
			this.xtraScrollableControl.Dock = DockStyle.Fill;
			this.xtraScrollableControl.Location = new System.Drawing.Point(0, 0);
			this.xtraScrollableControl.Name = "xtraScrollableControl";
			this.xtraScrollableControl.Size = new System.Drawing.Size(566, 161);
			this.xtraScrollableControl.TabIndex = 45;
			this.btnReferesh.ImageIndex = 11;
			this.btnReferesh.ImageList = this.imageList;
			this.btnReferesh.Location = new System.Drawing.Point(291, 140);
			this.btnReferesh.Name = "btnReferesh";
			this.btnReferesh.Size = new System.Drawing.Size(25, 24);
			this.btnReferesh.TabIndex = 43;
			this.toolTipEx.SetToolTip(this.btnReferesh, "强制更新日志分类列表");
			this.btnReferesh.UseVisualStyleBackColor = true;
			this.btnReferesh.Click += new EventHandler(this.btnReferesh_Click);
			this.label7.AutoSize = true;
			this.label7.ForeColor = System.Drawing.Color.White;
			this.label7.Location = new System.Drawing.Point(58, 143);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(63, 14);
			this.label7.TabIndex = 41;
			this.label7.Text = "日志分类";
			this.cbbNoteTypeName.DropDownStyle = ComboBoxStyle.DropDownList;
			this.cbbNoteTypeName.FormattingEnabled = true;
			this.cbbNoteTypeName.Location = new System.Drawing.Point(126, 140);
			this.cbbNoteTypeName.Name = "cbbNoteTypeName";
			this.cbbNoteTypeName.Size = new System.Drawing.Size(159, 22);
			this.cbbNoteTypeName.TabIndex = 40;
			this.cbbNoteTypeName.DropDown += new EventHandler(this.cbbNoteTypeName_DropDown);
			this.cbbNoteTypeName.SelectedIndexChanged += new EventHandler(this.cbbNoteTypeName_SelectedIndexChanged);
			this.cbbNoteTypeName.DropDownClosed += new EventHandler(this.cbbNoteTypeName_DropDownClosed);
			this.panel5.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.panel5.Controls.Add(this.rbbtn5);
			this.panel5.Location = new System.Drawing.Point(183, 422);
			this.panel5.Name = "panel5";
			this.panel5.Size = new System.Drawing.Size(17, 17);
			this.panel5.TabIndex = 39;
			this.rbbtn5.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rbbtn5.AutoSize = true;
			this.rbbtn5.Cursor = Cursors.Hand;
			this.rbbtn5.Location = new System.Drawing.Point(2, 2);
			this.rbbtn5.Name = "rbbtn5";
			this.rbbtn5.Size = new System.Drawing.Size(14, 13);
			this.rbbtn5.TabIndex = 31;
			this.rbbtn5.UseVisualStyleBackColor = true;
			this.panel4.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.panel4.Controls.Add(this.rbbtn4);
			this.panel4.Location = new System.Drawing.Point(166, 422);
			this.panel4.Name = "panel4";
			this.panel4.Size = new System.Drawing.Size(17, 17);
			this.panel4.TabIndex = 38;
			this.rbbtn4.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rbbtn4.AutoSize = true;
			this.rbbtn4.Cursor = Cursors.Hand;
			this.rbbtn4.Location = new System.Drawing.Point(2, 2);
			this.rbbtn4.Name = "rbbtn4";
			this.rbbtn4.Size = new System.Drawing.Size(14, 13);
			this.rbbtn4.TabIndex = 31;
			this.rbbtn4.UseVisualStyleBackColor = true;
			this.panel3.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.panel3.Controls.Add(this.rbbtn3);
			this.panel3.Location = new System.Drawing.Point(150, 422);
			this.panel3.Name = "panel3";
			this.panel3.Size = new System.Drawing.Size(17, 17);
			this.panel3.TabIndex = 37;
			this.rbbtn3.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rbbtn3.AutoSize = true;
			this.rbbtn3.Cursor = Cursors.Hand;
			this.rbbtn3.Location = new System.Drawing.Point(2, 2);
			this.rbbtn3.Name = "rbbtn3";
			this.rbbtn3.Size = new System.Drawing.Size(14, 13);
			this.rbbtn3.TabIndex = 31;
			this.rbbtn3.UseVisualStyleBackColor = true;
			this.panel2.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.panel2.Controls.Add(this.rbbtn2);
			this.panel2.Location = new System.Drawing.Point(134, 422);
			this.panel2.Name = "panel2";
			this.panel2.Size = new System.Drawing.Size(17, 17);
			this.panel2.TabIndex = 36;
			this.rbbtn2.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rbbtn2.AutoSize = true;
			this.rbbtn2.Cursor = Cursors.Hand;
			this.rbbtn2.Location = new System.Drawing.Point(2, 2);
			this.rbbtn2.Name = "rbbtn2";
			this.rbbtn2.Size = new System.Drawing.Size(14, 13);
			this.rbbtn2.TabIndex = 31;
			this.rbbtn2.UseVisualStyleBackColor = true;
			this.panel1.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.panel1.Controls.Add(this.rbbtn1);
			this.panel1.Location = new System.Drawing.Point(118, 422);
			this.panel1.Name = "panel1";
			this.panel1.Size = new System.Drawing.Size(17, 17);
			this.panel1.TabIndex = 35;
			this.rbbtn1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
			this.rbbtn1.AutoSize = true;
			this.rbbtn1.Cursor = Cursors.Hand;
			this.rbbtn1.Location = new System.Drawing.Point(2, 2);
			this.rbbtn1.Name = "rbbtn1";
			this.rbbtn1.Size = new System.Drawing.Size(14, 13);
			this.rbbtn1.TabIndex = 31;
			this.rbbtn1.UseVisualStyleBackColor = true;
			this.lbMsg.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left);
			this.lbMsg.AutoSize = true;
			this.lbMsg.ForeColor = System.Drawing.Color.White;
			this.lbMsg.Location = new System.Drawing.Point(57, 424);
			this.lbMsg.Name = "lbMsg";
			this.lbMsg.Size = new System.Drawing.Size(63, 14);
			this.lbMsg.TabIndex = 29;
			this.lbMsg.Text = "信号强度";
			this.label5.AutoSize = true;
			this.label5.ForeColor = System.Drawing.Color.White;
			this.label5.Location = new System.Drawing.Point(482, 90);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(63, 14);
			this.label5.TabIndex = 27;
			this.label5.Text = "结束时间";
			this.label4.AutoSize = true;
			this.label4.ForeColor = System.Drawing.Color.White;
			this.label4.Location = new System.Drawing.Point(322, 90);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(63, 14);
			this.label4.TabIndex = 26;
			this.label4.Text = "开始时间";
			this.dtpbegintime.Format = DateTimePickerFormat.Time;
			this.dtpbegintime.Location = new System.Drawing.Point(391, 86);
			this.dtpbegintime.Name = "dtpbegintime";
			this.dtpbegintime.ShowUpDown = true;
			this.dtpbegintime.Size = new System.Drawing.Size(85, 23);
			this.dtpbegintime.TabIndex = 25;
			this.dtpbegintime.Value = new DateTime(2009, 1, 15, 0, 0, 0, 0);
			this.dtpendtime.Format = DateTimePickerFormat.Time;
			this.dtpendtime.Location = new System.Drawing.Point(551, 86);
			this.dtpendtime.Name = "dtpendtime";
			this.dtpendtime.ShowUpDown = true;
			this.dtpendtime.Size = new System.Drawing.Size(80, 23);
			this.dtpendtime.TabIndex = 24;
			this.dtpendtime.Value = new DateTime(2009, 1, 15, 0, 0, 0, 0);

			this.pboxBody.InitialImage = null;
			this.pboxBody.Location = new System.Drawing.Point(6, 297);
			this.pboxBody.Name = "pboxBody";
			this.pboxBody.Size = new System.Drawing.Size(48, 48);
			this.pboxBody.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxBody.TabIndex = 23;
			this.pboxBody.TabStop = false;

			this.pboxWorkLoad.InitialImage = null;
			this.pboxWorkLoad.Location = new System.Drawing.Point(6, 74);
			this.pboxWorkLoad.Name = "pboxWorkLoad";
			this.pboxWorkLoad.Size = new System.Drawing.Size(48, 48);
			this.pboxWorkLoad.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxWorkLoad.TabIndex = 22;
			this.pboxWorkLoad.TabStop = false;
			
			this.pboxTopic.InitialImage = null;
			this.pboxTopic.Location = new System.Drawing.Point(270, 20);
			this.pboxTopic.Name = "pboxTopic";
			this.pboxTopic.Size = new System.Drawing.Size(48, 48);
			this.pboxTopic.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxTopic.TabIndex = 21;
			this.pboxTopic.TabStop = false;
			
			this.pboxDate.InitialImage = null;
			this.pboxDate.Location = new System.Drawing.Point(6, 20);
			this.pboxDate.Name = "pboxDate";
			this.pboxDate.Size = new System.Drawing.Size(48, 48);
			this.pboxDate.SizeMode = PictureBoxSizeMode.StretchImage;
			this.pboxDate.TabIndex = 20;
			this.pboxDate.TabStop = false;
			this.cbbWorkLoad.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.cbbWorkLoad.FormattingEnabled = true;
			this.cbbWorkLoad.Location = new System.Drawing.Point(126, 87);
			this.cbbWorkLoad.Name = "cbbWorkLoad";
			this.cbbWorkLoad.Size = new System.Drawing.Size(190, 22);
			this.cbbWorkLoad.TabIndex = 2;
			this.cbbWorkLoad.KeyPress += new KeyPressEventHandler(this.cbbWorkLoad_KeyPress);
			this.label3.AutoSize = true;
			this.label3.ForeColor = System.Drawing.Color.White;
			this.label3.Location = new System.Drawing.Point(60, 90);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(63, 14);
			this.label3.TabIndex = 17;
			this.label3.Text = "工 作 量";
			this.btnCancel.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnCancel.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this.btnCancel.ForeColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.btnCancel.Location = new System.Drawing.Point(560, 418);
			this.btnCancel.Name = "btnCancel";
			this.btnCancel.Size = new System.Drawing.Size(75, 26);
			this.btnCancel.TabIndex = 5;
			this.btnCancel.Text = "关闭(&C)";
			this.btnCancel.UseVisualStyleBackColor = false;
			this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
			this.btnSave.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right);
			this.btnSave.BackColor = System.Drawing.Color.FromArgb(192, 192, 255);
			this.btnSave.ForeColor = System.Drawing.Color.FromArgb(51, 79, 103);
			this.btnSave.Location = new System.Drawing.Point(479, 418);
			this.btnSave.Name = "btnSave";
			this.btnSave.Size = new System.Drawing.Size(75, 26);
			this.btnSave.TabIndex = 4;
			this.btnSave.Text = "保存(&S)";
			this.btnSave.UseVisualStyleBackColor = false;
			this.btnSave.Click += new EventHandler(this.btnSave_Click);
			this.dtpdate.Location = new System.Drawing.Point(126, 30);
			this.dtpdate.Name = "dtpdate";
			this.dtpdate.Size = new System.Drawing.Size(138, 23);
			this.dtpdate.TabIndex = 0;
			this.dtpdate.KeyPress += new KeyPressEventHandler(this.dtpdate_KeyPress);
			this.lbNoteDate.AutoSize = true;
			this.lbNoteDate.ForeColor = System.Drawing.Color.White;
			this.lbNoteDate.Location = new System.Drawing.Point(60, 35);
			this.lbNoteDate.Name = "lbNoteDate";
			this.lbNoteDate.Size = new System.Drawing.Size(63, 14);
			this.lbNoteDate.TabIndex = 12;
			this.lbNoteDate.Text = "日志日期";
			this.tboxtopic.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
			this.tboxtopic.Location = new System.Drawing.Point(391, 32);
			this.tboxtopic.MaxLength = 200;
			this.tboxtopic.Name = "tboxtopic";
			this.tboxtopic.Size = new System.Drawing.Size(240, 23);
			this.tboxtopic.TabIndex = 1;
			this.tboxtopic.KeyPress += new KeyPressEventHandler(this.tboxtopic_KeyPress);
			this.label1.AutoSize = true;
			this.label1.ForeColor = System.Drawing.Color.White;
			this.label1.Location = new System.Drawing.Point(322, 35);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(63, 14);
			this.label1.TabIndex = 10;
			this.label1.Text = "日志主题";
			this.toolTip.IsBalloon = true;
			this.toolTip.ToolTipIcon = ToolTipIcon.Info;
			this.toolTip.ToolTipTitle = "网络信号强度";
			this.timspy.Interval = 60000;
			this.timspy.Tick += new EventHandler(this.timspy_Tick);
			this.toolTipEx.IsBalloon = true;
			this.cbbNoteTypeID.FormattingEnabled = true;
			this.cbbNoteTypeID.Location = new System.Drawing.Point(211, 231);
			this.cbbNoteTypeID.Name = "cbbNoteTypeID";
			this.cbbNoteTypeID.Size = new System.Drawing.Size(244, 20);
			this.cbbNoteTypeID.TabIndex = 46;
			base.AutoScaleDimensions = new System.Drawing.SizeF(6f, 12f);
			this.BackColor = System.Drawing.Color.FromArgb(51, 79, 103);
			base.ClientSize = new System.Drawing.Size(667, 482);
			base.Controls.Add(this.groupBoxMain);
			base.Controls.Add(this.cbbNoteTypeID);
			this.Cursor = Cursors.Hand;

			base.Name = "FrmEditNote";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "日志编辑器";
			base.FormClosing += new FormClosingEventHandler(this.FrmEditNote_FormClosing);
			base.FormClosed += new FormClosedEventHandler(this.FrmEditNote_FormClosed);
			base.Load += new EventHandler(this.FrmEditNote_Load);
			base.Shown += new EventHandler(this.FrmEditNote_Shown);
			base.MouseDown += new MouseEventHandler(this.FrmEditNote_MouseDown);
			this.groupBoxMain.ResumeLayout(false);
			this.groupBoxMain.PerformLayout();
			((ISupportInitialize)this.xtraTabControl).EndInit();
			this.xtraTabControl.ResumeLayout(false);
			this.xtraTabPage1.ResumeLayout(false);
			this.xtraTabPage2.ResumeLayout(false);
			this.panel5.ResumeLayout(false);
			this.panel5.PerformLayout();
			this.panel4.ResumeLayout(false);
			this.panel4.PerformLayout();
			this.panel3.ResumeLayout(false);
			this.panel3.PerformLayout();
			this.panel2.ResumeLayout(false);
			this.panel2.PerformLayout();
			this.panel1.ResumeLayout(false);
			this.panel1.PerformLayout();
			((ISupportInitialize)this.pboxBody).EndInit();
			((ISupportInitialize)this.pboxWorkLoad).EndInit();
			((ISupportInitialize)this.pboxTopic).EndInit();
			((ISupportInitialize)this.pboxDate).EndInit();
			base.ResumeLayout(false);
		}
	}
}
